import React, { Component } from 'react';
import { Switch, Route, Redirect, Link, NavLink } from 'react-router-dom';
import CustomList from './coutom/customList';
import CustomHandle from './coutom/customHandle';
// import '../menu.css'
class Custor extends Component {
    render() {
    let power=localStorage.getItem('power');
        // console.log(this.props)
        return (
            // <>
            //     <h2>
            //         首页1
            //     </h2>
            // </>

            <>
                <div className="menuBox">
                    <Link to='/Custor/list'>我的客户</Link>
                  {power? <Link to={{
                        pathname:"/Custor/list",
                        search:"?name=kkw",
                    }}>全部客户</Link>:''} 
                    <Link to='/Custor/handle'>新增客户</Link>
                </div>
                {/* 二级路由 */}
                <Switch>{/*Switch包裹的是只要有一个路由匹配了就不再往下走 */}
                    <Redirect from='/Custor' exact to='/Custor/list' />
                    <Route path='/Custor/list' component={CustomList} />
                    <Route path='/Custor/handle' exact  component={CustomHandle} />
                    <Route path='/Custor/handle/:Id' component={CustomHandle} />
                </Switch>
            </>
        );
    }
}

export default Custor;